package practice04;

/**
 * @author Administrator
 * @version V1.0
 * @ProjectName:IntelliJ IDEA
 * @PackageName: practice04
 * @ClassName: WorkIT
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @date 2019/12/5 19:56
 * @Copyright 大牛版板所有
 */
public class WorkIT {
    private String name;
    private int age;
    private String technicalDire; // 技术方向
    private int workAge; // 工作年龄
    private String workCompany; // 工作单位
    private String duties; // 职务

    // 创建构造函数


    public WorkIT(String name, int age, String technicalDire, int workAge) {
        this.setName(name);
        this.setAge(age);
        this.technicalDire = technicalDire;
        this.setWorkAge(workAge);
    }

    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }
    public void setAge(int age) {
        if (age >= 15){
            this.age = age;
        }
        else {
            this.age = 15;
            System.out.println("从业人员年龄必须满15岁！");
        }
    }

    public String getTechnicalDire() {
        return technicalDire;
    }

    public int getWorkAge() {
        return workAge;
    }
    public void setWorkAge(int workAge) {
        this.workAge = workAge;
    }

    public String getWorkCompany() {
        return workCompany;
    }
    public void setWorkCompany(String workCompany) {
        this.workCompany = workCompany;
    }

    public String getDuties() {
        return duties;
    }
    public void setDuties(String duties) {
        this.duties = duties;
    }


    public void workMethod(String workCompany,String duties){
        this.setWorkCompany(workCompany);
        this.setDuties(duties);
        System.out.println(this.getWorkCompany()+"公司的"+this.getName()+"员工的年龄为："+this.getAge()+"，技术方法为："
                +this.getTechnicalDire() +"，职务为："+this.getDuties()+"，已经来公司"+this.getWorkAge()+"年了。");
    }


    public static void main(String[] args) {
        WorkIT work = new WorkIT("张三",23,"java架构师",5);
        work.workMethod("阿里巴巴","项目经理");
    }
}
